/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package crypto;

import java.io.Serializable;
import java.util.Calendar;


/**
 *
 * @author edi
 */
final class TweetImpl implements Tweet, Serializable{
    private String text = null;
    private int toUserId = -1;
    private String toUser = null;
    private String fromUser = null;
    private long id = -1;
    private int fromUserId = -1;
    private String isoLanguageCode = null;
    private String source = null;
    private String profileImageUrl = null;
    private Calendar createdAt = null;
    private String location = null;
    private static final long serialVersionUID = 649087720686234l;

    public String getText() {
        return text;
    }

    public void setText(String text){
        this.text = text;
    }

    public int getToUserId() {
        return toUserId;
    }

    public void setToUserId(int toUserId){
        this.toUserId = toUserId;
    }

    public String getToUser() {
        return toUser;
    }

    public void setToUser(String toUser){
        this.toUser = toUser;
    }

    public String getFromUser() {
        return fromUser;
    }

    public void setFromUser(String fromUser){
        this.fromUser = fromUser;
    }

    public long getId() {
        return id;
    }

    public void setId(long id){
        this.id = id;
    }

    public int getFromUserId() {
        return fromUserId;
    }

     public void setFromUserId(int fromUserId){
        this.fromUserId = fromUserId;
    }

   public String getIsoLanguageCode() {
        return isoLanguageCode;
    }

    public void setIsoLanguageCode(String isoLanguageCode){
        this.isoLanguageCode = isoLanguageCode;
    }

    public String getSource() {
        return source;
    }

    public void setSource(String source){
        this.source = source;
    }

    public String getProfileImageUrl() {
        return profileImageUrl;
    }

    public void setProfileImageUrl(String profileImageUrl){
        this.profileImageUrl = profileImageUrl;
    }

    public Calendar getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(Calendar createdAt){
        this.createdAt = createdAt;
    }

        public String getLocation() {
        return location;
    }

    public void setLocation(String location){
        this.location = location;
    }

    public int hashCode(){
        return (int) id;
    }

    public int compareTo(Tweet o) {
        if (o == null){
            String msg = "nullValue compareTo TweetImpl";
            throw new IllegalArgumentException(msg);
        }

        if (this == o || this.id == o.getId()){
            return 0;
        }


        if (this.id < o.getId()){
            return -1;
        }
        return 1;
    }

@Override
public int compareTo(Object o) {
        if(!(o instanceof TweetImpl)){
            String msg = "trying to compare Tweet to "+o.getClass();
            throw new IllegalArgumentException(msg);
        }
        return compareTo((TweetImpl) o);
    }
}

